//
//  ForgetVC.m
//  LoginTest
//
//  Created by 战立军 on 2017/2/20.
//  Copyright © 2017年 战立军. All rights reserved.
//

#import "ForgetVC.h"
#import "ForgetView.h"

@interface ForgetVC ()<ForgetViewDelegate>
{
    ForgetView *_forgetView;
}
@end

@implementation ForgetVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setNav];
    
    if (!_forgetView)
    {
        _forgetView = [[ForgetView alloc] initWithFrame:self.view.frame];
        _forgetView.delegate = self;
    }
    
    self.view = _forgetView;
    
    // Do any additional setup after loading the view.
}

- (void)setNav
{
    //标题
    self.navigationItem.title = @"找回密码";
    
    //导航栏颜色
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    
    //导航栏颜色
    [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"uitabr"]]];
    
    //返回
    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"qz_icon_facade_back_light_normal"] style:UIBarButtonItemStylePlain target:self action:@selector(backButtonPress)];
    leftButton.tintColor = [UIColor whiteColor];
    self.navigationItem.leftBarButtonItem = leftButton;
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
    [_forgetView.tiemr setFireDate:[NSDate distantFuture]];
    _forgetView.tiemr = nil;
    _forgetView.delegate = nil;
    _forgetView = nil;
}


- (void)backButtonPress
{
    [self dismissViewControllerAnimated:YES completion:nil];
}
#pragma mark ForgetViewDelegate

-(void)forgetViewgetsmsButtonPressWithPhone:(NSString *)phone
{
     NSLog(@"%s",__func__);
    [UIUTils showReminderMBProgressHUDWithTitle:@"验证码已发送，请注意短信" view:self.view];
}

-(void)forgetViewsetpwdButtonPress
{
     NSLog(@"%s",__func__);
    
}


@end
